<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 11后台主题UI框架 - 数据表格</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> 
	<link href="__ADMINCSS__/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="__ADMINCSS__/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="__ADMINCSS__/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="__ADMINCSS__/animate.min.css" rel="stylesheet">
    <link href="__ADMINCSS__/style.min.css?v=4.0.0" rel="stylesheet">
    <!-- Sweet Alert -->
    <link href="__ADMINCSS__/plugins/sweetalert/sweetalert.css" rel="stylesheet">

	<style>
		.table {color:#000;}
	</style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
       
		
		<div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>站点配置管理</h5>
                        <div class="ibox-tools">
                            <a href="javascript:location=location;">
                                刷新
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
						<div class="">
                            <a href="{:url('siteAdd')}"  class=" btn btn-primary ">添加站点</a>
                        </div>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th >站点名称</th>
                                    <th>站点标识</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
								{volist name="res" id="vo"}
                                <tr  id="data<?php echo $vo['id'];?>">
                                    <td>{$vo['id']}</td>
                                    <td >{$vo['sitename']}</td>
                                    <td>{$vo['sitekey']}</td>
									<td>
										<a href="{:url('admin/system/siteUpdate',array('id'=>$vo['id']))}"  class=" btn btn-primary btn-sm">修改</a>
										<a authid="{$vo['id']}" class="demo3  btn btn-primary btn-sm btn-danger ">删除</a>
									</td>
                                </tr>
								{/volist}
                            </tbody>
                        </table>

                    </div>
                </div>
            </div>
            
        </div>
    </div>
    <script src="__ADMINJS__/jquery-2.1.1.js"></script>
    
	<!-- 删除弹出框 -->
	<script src="__ADMINJS__/plugins/sweetalert/sweetalert.min.js"></script>
    <script>
        $('.demo3').click(function () {
			var authid = $(this).attr("authid");
			swal({
				title: "您确定要删除这条信息吗",
				text: "删除后将无法恢复，请谨慎操作！",
				type: "warning",
				showCancelButton: true,
				confirmButtonColor: "#DD6B55",
				confirmButtonText: "删除",
				closeOnConfirm: false
			}, function () {
				$.post('<?php echo url('admin/System/siteDel');?>', {id:authid}, function (data) {
					if(data.status == 404){
						swal("删除失败！", data.msg, "error");
						exit;
					}
					
					if(data.status == 200){
						swal("删除成功！", data.msg, "success");
						$("#data"+authid).css("display","none");
					}
					
				},'json');
				
				
			});
		});
	</script>
</body>

</html>